#ifndef BIRD_H
#define BIRD_H
#include "../main_head.h"

class Bird
{
private:
	GLfloat position[20] = {        
		 0.065f,  0.0750f, 0.2f,    1.0f, 1.0f,// Top Right
		 0.065f, -0.0750f, 0.2f,    1.0f, 0.0f,// Bottom Right
		-0.065f, -0.0750f, 0.2f,    0.0f, 0.0f,// Bottom Left
		-0.065f,  0.0750f, 0.2f,    0.0f, 1.0f	// Top Left
	};
	GLuint indices[6] = {  // Note that we start from 0!
		0, 1, 3, // First Triangle
		1, 2, 3  // Second Triangle
	};
	glm::vec3 birdPositions[1] = { glm::vec3(0.0f, 0.0f, 0.0f)};

	GLuint VBO, VAO, EBO, Program, time = 0, up_time = 0;
	GLuint texture;
	GLfloat angle = 0;
	GLboolean live = 1;

	GLint fall_up_time = 150, fall_time = 1;
public:
	void set_time(GLuint _time) { time = _time; }
	void set_up_time(GLuint _up_time) { up_time = _up_time; }
	void set_angle(GLfloat _angle) { angle = _angle; }
	void set_live(GLboolean _live) { live = _live; }
	void set_fall_up_time(GLint _) { fall_up_time = _; }
	void set_fall_time(GLint _) { fall_time = _; }
	Bird(GLint _program);
	void set_live(GLint _live);
	void control(GLint up);
	void load_image();
	void load_coord();
	bool judge(glm::vec3 pipePositions[], int view);
	bool get_the_point(glm::vec3 pipePositions[], int view);
	void fall();
	void draw();
	void burn();
};

#endif


